package com.study.demo_spring_security.controller;

import com.study.demo_spring_security.service.MethodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: HelloController
 * @Description:
 * @author: WS
 * @date 2020/12/27
 * @Version: 1.0
 **/
@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(){
        return "hello security!";
    }
    @GetMapping("/admin/hello")
    public String admin(){
        return "hello admin!";
    }
    @GetMapping("/user/hello")
    public String user(){
        return "hello user!";
    }

    @Autowired
    MethodService methodService;

    @GetMapping("/method/hello")
    public String methodHello(){
        return methodService.hello();
    }
    @GetMapping("/method/admin")
    public String methodAdmin(){
        return methodService.admin();
    }
    @GetMapping("/method/user")
    public String methodUser(){
        return methodService.user();
    }
}
